import my from './index'

let reducer = (state = { ...my.state }, action: {type: string, value: number}) => {
    let newState = JSON.parse(JSON.stringify(state))
    for(let key in my.actionsName) {
        if(action.type === my.actionsName[key]) {
            my.actions[my.actionsName[key]](newState, action.value)
        }
    }
    return newState
}


export default reducer